package oop.ex2.enums;

import java.util.regex.Pattern;

public enum VariableValueEnum {
    STRING("\\s*\".+\""), 
    INT("-{0,1}\\d+"), 
    DOUBLE("-{0,1}\\d+(\\.\\d+)*"), 
    BOOLEAN(INT.getRegex() + "|" + DOUBLE.getRegex() + "|" + "true|false"), 
    CHAR("\\s*'.'");

    private String regex;
    private Pattern enumPattern;

    private VariableValueEnum(String regex) {
        this.setRegex(regex);
        this.enumPattern = Pattern.compile(regex);
    }

    public String getRegex() {
        return regex;
    }

    public void setRegex(String regex) {
        this.regex = regex;
    }

    public Pattern getEnumPattern() {
        return enumPattern;
    }
}
